package com.projeto.persistence;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * The persistent class for the receipt database table.
 *
 */
@Entity
@Table(name = "EVENTS")
public class Event implements Serializable {

    public enum EVENT {
        INSERT, UPDATE, DELETE, LOGIN;
    };
    
    private static final long serialVersionUID = 1L;
    @Id
    private String id;
    @Temporal( TemporalType.TIMESTAMP)
    @Column(name = "CREATE_DT")
    private Date createDt;
    @Column(name = "ANTES")
    private String before;
    @Column(name = "DEPOIS")
    private String after;
    @Enumerated(EnumType.ORDINAL)
    private EVENT event;
    @Column(name = "CREATED_BY")
    private String createdBy;

    public Event() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getCreateDt() {
        return this.createDt;
    }

    public void setCreateDt(Date createDt) {
        this.createDt = createDt;
    }

    public String getCreatedBy() {
        return this.createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public String getBefore() {
        return before;
    }

    public void setBefore(String before) {
        this.before = before;
    }

    public String getAfter() {
        return after;
    }

    public void setAfter(String after) {
        this.after = after;
    }

    public EVENT getEvent() {
        return event;
    }

    public void setEvent(EVENT event) {
        this.event = event;
    }

    @Override
    public String toString() {
        return "Event [id=" + id + ", createDt=" + createDt + ", before="
                + before + ", after=" + after + ", event=" + event
                + ", createdBy=" + createdBy + "]";
    }
}